﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.EventSystems;
using Photon;


public class TurretController : MotionController 
{
    public override void Attack(LifeController lc)
	{   
		if (lifeController.isDead || lc.isDead)
		{
			
		}else
		{	
			if (lc.teamAble.team != 2) // dont attack NPC's with turrets
			{
				attacker.Target (lc);
			}
			
		}
	}
    void FixedUpdate()
	{
		if (!attacker.TargetInRange())
		{
			attacker.Relax();
		}
    }
    public override void GoTo(Vector3 position)
	{	
		attacker.Relax();
	}


}
